package cn.dmp.tags

import org.apache.commons.lang.StringUtils
import org.apache.spark.sql.Row

/**
  * Created by Administrator on 2018/4/29.
  */
object Tags4ProCity extends Tags{
  override def makeTags(args: Any*): Map[String, Int] = {

    val row = args(0).asInstanceOf[Row]
    //定义一个Map集合装数据
    var tags = Map[String,Int]()
    val pname = row.getAs[String]("provincename")
    val cname = row.getAs[String]("cityname")
    if (StringUtils.isNotEmpty(pname)) tags += "ZP" + pname -> 1
    if (StringUtils.isNotEmpty(cname)) tags += "ZC" + pname -> 1

    tags
  }
}
